package mao.others.vivo;

import java.util.Scanner;

public class Main {
    //手机检测问题
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        while (s.hasNext()){
            int phone,floor;
            phone=s.nextInt();
            floor=s.nextInt();
            if(phone<=1){
                System.out.println(floor);
            }else {
                int res=0;
                while (floor > 0 && phone>1){
                    floor/=2;
                    phone-=1;
                    res+=1;
                    if(floor == 0){
                        System.out.println(res);
                    }
                }
                res+=floor;
                System.out.println(res);
            }
        }
    }

}